package com.hsc.www.integration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.integration.dsl.IntegrationFlow;
import org.springframework.integration.dsl.IntegrationFlows;
import org.springframework.integration.dsl.MessageChannels;

@Configuration
public class RegisterIntegrationConfig {

    @Bean
    public IntegrationFlow registerFlow(RegisterRabbitMQSendHandler registerRabbitMQSendHandler, RegisterMessageFilter registerMessageFilter) {
        return IntegrationFlows
                //从registerChannel消息通道获取消息
                .from(MessageChannels.direct("registerChannel"))
                //过滤
                .filter(registerMessageFilter)
                //发送邮件
                .handle(registerRabbitMQSendHandler)
                .get();

    }
}